#include "apue.h"
#include "error.c"
#include <fcntl.h>

#define RWRWRW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)

int main(int argc, char const *argv[])
{
    umask(0);
    if(creat("foo", RWRWRW) < 0)
        err_sys("creat foo file error ");
    
    umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);

    if(creat("bar", RWRWRW) < 0)
        err_sys("craet bar file error");

    return 0;
}